#include <iostream>
#include <algorithm>
using namespace std;


int main(){
	int n;
	cin>>n;
	int a[n];
	for(int i=0;i<n;i++)
		cin>>a[i];
	sort(a,a+n);
	int left=0,right=n-1;
	bool which=true;
	while(left <= right){
		if(which){
			cout<<a[right]<<endl;
			right--;
			which = false;
		}
		else{
			cout<<a[left]<<endl;
			left++;
			which = true;
		}
	}
	return 0;
}
